
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>system.TypeTuple</title>
<link rel="stylesheet" type="text/css" href="candydoc/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]-->
<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("system.TypeTuple");</script>
	<table class="content">
		<tr><td id="docbody"><h1>system.TypeTuple</h1><!-- Generated by Ddoc from F:\MyWork\phoenix\source\system\TypeTuple.d -->
Templates with which to manipulate type tuples (also known as type lists).
<br><br>
Some operations on type tuples are built in to the language,
 such as TL[<i>n</i>] which gets the <i>n</i>th type from the
 type tuple. TL[<i>lwr</i> .. <i>upr</i>] returns a new type
 list that is a slice of the old one.

<br><br>
<b>References:</b><br>
Based on ideas in Table 3.1 from
	<a href="http://www.amazon.com/exec/obidos/ASIN/0201704315/ref=ase_classicempire/102-2957199-2585768">		Modern C++ Design</a>,
	 Andrei Alexandrescu (Addison-Wesley Professional, 2001)
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">TypeTuple</span>
<script>explorer.outline.addDecl('TypeTuple');</script>

(TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Creates a typetuple out of a sequence of zero or more types.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>import</font> std.typetuple;
 <font color=blue>alias</font> <u>TypeTuple</u>!(<font color=blue>int</font>, <font color=blue>double</font>) TL;

 <font color=blue>int</font> foo(TL td)  <font color=green>// same as int foo(int, double);
</font> {
    <font color=blue>return</font> td[0] + <font color=blue>cast</font>(<font color=blue>int</font>)td[1];
 }
</pre>

<br><br>
<b>Example:</b><br>
<pre class="d_code"> <u>TypeTuple</u>!(TL, <font color=blue>char</font>)
 <font color=green>// is equivalent to:
</font> <u>TypeTuple</u>!(<font color=blue>int</font>, <font color=blue>double</font>, <font color=blue>char</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">indexOf</span>
<script>explorer.outline.addDecl('indexOf');</script>

(T,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns the index of the first occurrence of type T in the
 sequence of zero or more types TList.
 If not found, -1 is returned.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>import</font> std.typetuple;
 <font color=blue>import</font> std.stdio;

 <font color=blue>void</font> foo()
 {
    writefln(<font color=red>"The index of long is "</font>,
          <u>indexOf</u>!(<font color=blue>long</font>, TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>double</font>)));
    <font color=green>// prints: The index of long is 1
</font> }
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">alias 
<span class="currsymbol">IndexOf</span>
<script>explorer.outline.addDecl('IndexOf');</script>

;
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Kept for backwards compatibility
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">Erase</span>
<script>explorer.outline.addDecl('Erase');</script>

(T,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with the first occurrence,
 if any, of T removed.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <u>Erase</u>!(<font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>double</font>, <font color=blue>char</font>)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>double</font>, <font color=blue>char</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">EraseAll</span>
<script>explorer.outline.addDecl('EraseAll');</script>

(T,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with the all occurrences,
 if any, of T removed.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>alias</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>) TL;

 <u>EraseAll</u>!(<font color=blue>long</font>, TL)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>int</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">NoDuplicates</span>
<script>explorer.outline.addDecl('NoDuplicates');</script>

(TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with the all duplicate
 types removed.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>alias</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>float</font>) TL;

 <u>NoDuplicates</u>!(TL)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>float</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">Replace</span>
<script>explorer.outline.addDecl('Replace');</script>

(T,U,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with the first occurrence
 of type T, if found, replaced with type U.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>alias</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>float</font>) TL;

 <u>Replace</u>!(<font color=blue>long</font>, <font color=blue>char</font>, TL)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>char</font>, <font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>float</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">ReplaceAll</span>
<script>explorer.outline.addDecl('ReplaceAll');</script>

(T,U,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with all occurrences
 of type T, if found, replaced with type U.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>alias</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>float</font>) TL;

 <u>ReplaceAll</u>!(<font color=blue>long</font>, <font color=blue>char</font>, TL)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>char</font>, <font color=blue>char</font>, <font color=blue>int</font>, <font color=blue>float</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">Reverse</span>
<script>explorer.outline.addDecl('Reverse');</script>

(TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns a typetuple created from TList with the order reversed.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>alias</font> TypeTuple!(<font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>, <font color=blue>float</font>) TL;

 <u>Reverse</u>!(TL)
 <font color=green>// is the same as:
</font> TypeTuple!(<font color=blue>float</font>, <font color=blue>int</font>, <font color=blue>long</font>, <font color=blue>long</font>, <font color=blue>int</font>)
</pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">MostDerived</span>
<script>explorer.outline.addDecl('MostDerived');</script>

(T,TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns the type from TList that is the most derived from type T.
 If none are found, T is returned.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>class</font> A { }
 <font color=blue>class</font> B : A { }
 <font color=blue>class</font> C : B { }
 <font color=blue>alias</font> TypeTuple!(A, C, B) TL;

 <u>MostDerived</u>!(Object, TL) x;  <font color=green>// x is declared as type C
</font></pre>
 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">DerivedToFront</span>
<script>explorer.outline.addDecl('DerivedToFront');</script>

(TList...)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Returns the typetuple TList with the types sorted so that the most
 derived types come first.
<br><br>
<b>Example:</b><br>
<pre class="d_code"> <font color=blue>class</font> A { }
 <font color=blue>class</font> B : A { }
 <font color=blue>class</font> C : B { }
 <font color=blue>alias</font> TypeTuple!(A, C, B) TL;

 <u>DerivedToFront</u>!(TL)
 <font color=green>// is the same as:
</font> TypeTuple!(C, B, A)
</pre>
 
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</td></tr>
		<tr><td id="docfooter">
			Page was generated with
			<img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px">
			on Sat Nov 29 22:33:13 2008

		</td></tr>
	</table>
</div>
<script>
	explorer.packageExplorer.addModule("platform.PAL");
	explorer.packageExplorer.addModule("platform.windows.Core");
	explorer.packageExplorer.addModule("platform.linux.Core");
	explorer.packageExplorer.addModule("system.Array");
	explorer.packageExplorer.addModule("system.BitArray");
	explorer.packageExplorer.addModule("system.Environment");
	explorer.packageExplorer.addModule("system.Event");
	explorer.packageExplorer.addModule("system.Exception");
	explorer.packageExplorer.addModule("system.Hash");
	explorer.packageExplorer.addModule("system.IntPtr");
	explorer.packageExplorer.addModule("system.Random");
	explorer.packageExplorer.addModule("system.Traits");
	explorer.packageExplorer.addModule("system.TypeTuple");
	explorer.packageExplorer.addModule("system.math.IEEE");
	explorer.packageExplorer.addModule("system.math.Math");
	explorer.packageExplorer.addModule("system.runtime.c.complex");
	explorer.packageExplorer.addModule("system.runtime.c.config");
	explorer.packageExplorer.addModule("system.runtime.c.ctype");
	explorer.packageExplorer.addModule("system.runtime.c.errno");
	explorer.packageExplorer.addModule("system.runtime.c.fenv");
	explorer.packageExplorer.addModule("system.runtime.c.inttypes");
	explorer.packageExplorer.addModule("system.runtime.c.limits");
	explorer.packageExplorer.addModule("system.runtime.c.locale");
	explorer.packageExplorer.addModule("system.runtime.c.math");
	explorer.packageExplorer.addModule("system.runtime.c.signal");
	explorer.packageExplorer.addModule("system.runtime.c.stdarg");
	explorer.packageExplorer.addModule("system.runtime.c.stddef");
	explorer.packageExplorer.addModule("system.runtime.c.stdint");
	explorer.packageExplorer.addModule("system.runtime.c.stdio");
	explorer.packageExplorer.addModule("system.runtime.c.stdlib");
	explorer.packageExplorer.addModule("system.runtime.c.string");
	explorer.packageExplorer.addModule("system.runtime.c.time");
	explorer.packageExplorer.addModule("system.runtime.c.wctype");
	explorer.packageExplorer.addModule("system.text.UTF");
	explorer.packageExplorer.addModule("system.threading.Atomic");
	explorer.packageExplorer.addModule("system.threading.ThreadUtility");
	explorer.packageExplorer.addModule("system.threading.synchronization.SpinWait");
	explorer.packageExplorer.addModule("system.collections.ArrayList");
	explorer.packageExplorer.addModule("system.collections.Comparer");
	explorer.packageExplorer.addModule("system.collections.Deque");
	explorer.packageExplorer.addModule("system.collections.EqualityComparer");
	explorer.packageExplorer.addModule("system.collections.Exception");
	explorer.packageExplorer.addModule("system.collections.HashMap");
	explorer.packageExplorer.addModule("system.collections.HashSet");
	explorer.packageExplorer.addModule("system.collections.ICollection");
	explorer.packageExplorer.addModule("system.collections.IComparer");
	explorer.packageExplorer.addModule("system.collections.IDeque");
	explorer.packageExplorer.addModule("system.collections.IEnumerable");
	explorer.packageExplorer.addModule("system.collections.IEnumerator");
	explorer.packageExplorer.addModule("system.collections.IEqualityComparer");
	explorer.packageExplorer.addModule("system.collections.IList");
	explorer.packageExplorer.addModule("system.collections.IMap");
	explorer.packageExplorer.addModule("system.collections.IQueue");
	explorer.packageExplorer.addModule("system.collections.LinkedList");
	explorer.packageExplorer.addModule("system.collections.Pair");
	explorer.packageExplorer.addModule("system.collections.PrimeHelper");
	explorer.packageExplorer.addModule("system.collections.PriorityQueue");
	explorer.packageExplorer.addModule("system.collections.Queue");
	explorer.packageExplorer.addModule("system.collections.RBTree");
	explorer.packageExplorer.addModule("system.collections.Stack");
	explorer.packageExplorer.addModule("system.collections.TreeMap");
	explorer.packageExplorer.addModule("system.collections.TreeSet");
	explorer.packageExplorer.addModule("system.collections.objectmodel.ListCollection");
	explorer.packageExplorer.addModule("system.collections.objectmodel.ReadOnlyListCollection");</script>
</body></html>


